if (St.Widget.get_default_direction() == St.TextDirection.RTL)
side = St.Side.RIGHT;
- PopupMenu.PopupMenu.prototype._init.call(this, source.actor, St.Align.MIDDLE, side, 0);
+ PopupMenu.PopupMenu.prototype._init.call(this, source.actor, 0.5, side, 0);
this._source = source;
// separated from its sourceActor
let primary = global.get_primary_monitor();
let themeNode = this.actor.get_theme_node();
- let halfBorder = themeNode.get_length('-arrow-border-width') / 2;
- let halfBase = themeNode.get_length('-arrow-base') / 2;
+ let borderWidth = themeNode.get_length('-arrow-border-width');
+ let arrowBase = themeNode.get_length('-arrow-base');
let borderRadius = themeNode.get_length('-arrow-border-radius');
+ let margin = (4 * borderRadius + borderWidth + arrowBase);
+ let halfMargin = margin / 2;
let resX, resY;
switch (this._arrowSide) {
case St.Side.TOP:
case St.Side.BOTTOM:
- switch (alignment) {
- case St.Align.START:
- resX = sourceCenterX - (halfBase + borderRadius + halfBorder);
- break;
- case St.Align.MIDDLE:
- resX = sourceCenterX - (natWidth / 2);
- break;
- case St.Align.END:
- resX = sourceCenterX - natWidth + (halfBase + borderRadius + halfBorder);
- break;
- }
+ resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
resX = Math.max(resX, primary.x + 10);
resX = Math.min(resX, primary.x + primary.width - (10 + natWidth));
case St.Side.LEFT:
case St.Side.RIGHT:
- switch (alignment) {
- case St.Align.START:
- resY = sourceCenterY - (halfBase + borderRadius + halfBorder);
- break;
- case St.Align.MIDDLE:
- resY = sourceCenterY - (natHeight / 2);
- break;
- case St.Align.END:
- resY = sourceCenterY - natHeight + (halfBase + borderRadius + halfBorder);
- break;
- }
+ resY = sourceCenterY - (halfMargin + (natHeight - margin) * alignment);
resY = Math.max(resY, primary.y + 10);
resY = Math.min(resY, primary.y + primary.height - (10 + natHeight));
//this._eventSource = new Calendar.FakeEventSource();
this._eventSource = new Calendar.EvolutionEventSource();
- PanelMenu.Button.prototype._init.call(this, St.Align.START);
+ PanelMenu.Button.prototype._init.call(this, 0.0);
this._clock = new St.Label();
this.actor.set_child(this._clock);
if (!this._clickedSummaryItem)
return;
- this._summaryNotificationBoxPointer.setPosition(this._clickedSummaryItem.actor, 0, St.Align.MIDDLE);
+ this._summaryNotificationBoxPointer.setPosition(this._clickedSummaryItem.actor, 0, 0.5);
},
_unsetClickedSummaryItem: function() {
__proto__: PanelMenu.Button.prototype,
_init: function() {
- PanelMenu.Button.prototype._init.call(this, St.Align.START);
+ PanelMenu.Button.prototype._init.call(this, 0.0);
this._metaDisplay = global.screen.get_display();
this._startingApps = [];
__proto__: Button.prototype,
_init: function(iconName,tooltipText) {
- Button.prototype._init.call(this, St.Align.START);
+ Button.prototype._init.call(this, 0.0);
this._iconActor = new St.Icon({ icon_name: iconName,
icon_type: St.IconType.SYMBOLIC,
style_class: 'system-status-icon' });
__proto__: PanelMenu.Button.prototype,
_init: function() {
- PanelMenu.Button.prototype._init.call(this, St.Align.START);
+ PanelMenu.Button.prototype._init.call(this, 0.0);
let box = new St.BoxLayout({ name: 'panelStatusMenu' });
this.actor.set_child(box);